<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>

<%@page import="java.util.List"%>
<%@page import="cl.gob.ips.offline.util.Tarea"%><html>
<head>
	<title>POC - IPS</title>
	
	<link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/principal.css" rel="stylesheet" type="text/css" />
	
<script type="text/javascript">

function finaliza(id){

	document.ingresarSolicitudForm.action = "liberaTarea.do";
	document.ingresarSolicitudForm.taskId.value = id;
	document.ingresarSolicitudForm.submit();
}
</script>
</head>
<body>
<html:form action="/liberaTarea.do">
<html:hidden property="taskId"/>
</html:form>
    <table border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td>
            	<table border="1">
            	<% List<Tarea> tareas = (List<Tarea>)request.getAttribute("tareas");
            	
            	if(tareas.size()==1 && tareas.get(0).getId().equals("0")){
            		String mensaje = (String)request.getAttribute("vacio");
            	%>
            		<tr>
        			 <td>
        				<%=mensaje %>
        			</td>
        			</tr>
        		<%  
            	}else{
            	   for(int i=0; i< tareas.size();i++){
            	%>
            		<tr>
            			<td>
            				<%=tareas.get(i).getId() %>
            			</td>  
            			<td>
            				<%=tareas.get(i).getNombre() %>
            			</td>  
            			<td>
            				<%=tareas.get(i).getDescripcion() %>
            			</td>   
            		</tr>
            	<% 
            	   }
            	}
            	%>  
            	</table>
            </td>
        </tr>
    </table>

</body>
</html>